﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 策略模式
{
  public  class Context
    {
        private int _iInputLeft = 0;
        private int _iInputRight=0;
        private BaseCaculation _baseCaculation = null;
        public Context(int iInputLeft, int iInputRight, BaseCaculation baseCaculation)
        {

            this._iInputLeft = iInputLeft;
            this._iInputRight = iInputRight;
            this._baseCaculation = baseCaculation;
        }

        public int Caculation()
        {

            try
            {
                return this._baseCaculation.Cuculation(this._iInputLeft, this._iInputRight);
            }
            catch (Exception)
            {

                throw;
            }
           
        }
    }
}
